const String _numbers = "0123456789";

extension Text on String {
  bool get isPureNumber {
    for (int i = 0; i < length; i++) {
      if (!_numbers.contains(this[i])) return false;
    }
    return true;
  }

  int get chineseCount {
    int count = 0;
    for (String i in this.split("")) {
      RegExp chinese = RegExp('[\u4e00-\u9fff]+');
      if (i.contains(chinese)) count++;
    }
    return count;
  }
}
